package com.aliya.glide.builder

import android.util.Log
import com.bumptech.glide.load.Key
import com.bumptech.glide.load.engine.Resource
import com.bumptech.glide.load.engine.cache.LruResourceCache

/**
 * LruResourceCacheAdapter
 *
 * @author a_liYa
 * @date 2022/2/19 17:38.
 *
 */
class LruResourceCacheAdapter(size: Long) : LruResourceCache(size) {

    companion object {
        const val TAG = "内存缓存"
    }

    override fun get(key: Key): Resource<*>? {
        val get = super.get(key)
        Log.e(TAG, "get: $get; key: $key" )
        return get
    }

    override fun put(key: Key, item: Resource<*>?): Resource<*>? {
        Log.e(TAG, "put: $item; key: $key" )
        return super.put(key, item)

    }
}